// 持久层
// 引入mongoose模块
const mongoose = require("mongoose");

let postSchema = new mongoose.Schema({
  poster: String, // 发帖人
  title: String, // 标题
  content: String, // 发帖内容
  state: String, // 帖子状态
  tags: Array, // 帖子含有的标签
  comments: Array, // 帖子评论
  createTime: Date, // 发帖时间
});

module.exports = mongoose.model("postModel", postSchema, "posts");
